﻿/*
*VMukti -- An open source video conferencing platform.
*
* Copyright (C) 2007 - 2008, VMukti Solutions Pvt. Ltd.
*
* Hardik Sanghvi <hardik@vmukti.com>
*
* See http://www.vmukti.com for more information about
* the VMukti project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, forums and mailing lists
* for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
using System;
using System.Windows;
using System.Windows.Controls;
using VMuktiAPI;

namespace VMukti.Presentation.Controls
{
    public partial class CtlSettings:IDisposable
    {
        public CtlSettings()
        {
            try
            {
                this.InitializeComponent();
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "CtlSettings()--:--CtlSettings.xaml.cs--:--" + ex.Message + " :--:--");
                ClsException.LogError(ex);
                ClsException.WriteToErrorLogFile(ex);

            }

            // Insert code required on object creation below this point.
        }

        void btnDone_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ((Canvas)this.Parent).Visibility = Visibility.Collapsed;
                cnvUploadGeneral.Visibility = Visibility.Collapsed;
                cnvUploadMod.Visibility = Visibility.Collapsed;
                cnvFTP.Visibility = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "btnDone_Click()--:--CtlSettings.xaml.cs--:--" + ex.Message + " :--:--");
                ClsException.LogError(ex);
                ClsException.WriteToErrorLogFile(ex);

            }

        }
        void btnClose_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ((Canvas)this.Parent).Visibility = Visibility.Collapsed;
                cnvUploadGeneral.Visibility = Visibility.Collapsed;
                cnvUploadMod.Visibility = Visibility.Collapsed;
                cnvFTP.Visibility = Visibility.Collapsed;
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "btnClose_Click()--:--CtlSettings.xaml.cs--:--" + ex.Message + " :--:--");
                ClsException.LogError(ex);
                ClsException.WriteToErrorLogFile(ex);

            }

        }
        public void btnGeneral_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                cnvUploadGeneral.Visibility = Visibility.Visible;
                cnvUploadMod.Visibility = Visibility.Collapsed;
                cnvFTP.Visibility = Visibility.Collapsed;
                cnvPBX.Visibility = Visibility.Collapsed;
                btnAddMod.IsChecked = false;
                btnFTP.IsChecked = false;
                btnPBX.IsChecked = false;
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "btnGeneral_Click()--:--CtlSettings.xaml.cs--:--" + ex.Message + " :--:--");
                ClsException.LogError(ex);
                ClsException.WriteToErrorLogFile(ex);

            }

        }
        public void btnAddMod_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                cnvUploadMod.Visibility = Visibility.Visible;
                cnvUploadGeneral.Visibility = Visibility.Collapsed;
                cnvFTP.Visibility = Visibility.Collapsed;
                cnvPBX.Visibility = Visibility.Collapsed;
                btnGeneral.IsChecked = false;
                btnFTP.IsChecked = false;
                btnPBX.IsChecked = false;
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "btnAddMod_Click()--:--CtlSettings.xaml.cs--:--" + ex.Message + " :--:--");
                ClsException.LogError(ex);
                ClsException.WriteToErrorLogFile(ex);

            }

        }
        public void btnFTP_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                cnvFTP.Visibility = Visibility.Visible;
                cnvUploadGeneral.Visibility = Visibility.Collapsed;
                cnvUploadMod.Visibility = Visibility.Collapsed;
                cnvPBX.Visibility = Visibility.Collapsed;
                btnGeneral.IsChecked = false;
                btnAddMod.IsChecked = false;
                btnPBX.IsChecked = false;
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "btnFTP_Click()--:--CtlSettings.xaml.cs--:--" + ex.Message + " :--:--");
                ClsException.LogError(ex);
                ClsException.WriteToErrorLogFile(ex);

            }


        }

        private void btnPBX_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                cnvPBX.Visibility = Visibility.Visible;
                cnvUploadGeneral.Visibility = Visibility.Collapsed;
                cnvUploadMod.Visibility = Visibility.Collapsed;
                cnvFTP.Visibility = Visibility.Collapsed;
                btnGeneral.IsChecked = false;
                btnAddMod.IsChecked = false;
                btnFTP.IsChecked = false;
            }
            catch (Exception ex)
            {
                ex.Data.Add("My Key", "btnPBX_Click()--:--CtlSettings.xaml.cs--:--" + ex.Message + " :--:--");
                ClsException.LogError(ex);
                ClsException.WriteToErrorLogFile(ex);

            }

        }

        #region IDisposable Members

        public void Dispose()
        {
           
        }

        #endregion

        ~CtlSettings()
        {
            Dispose();
        }
    }

}